<?php
function maintenance_mode() {
include("../processing/global-settings.php5");

mysql_connect($dbhost, $dbuser, $dbpass)or die("Could not connect: " . mysql_error());
mysql_select_db($dbname) or die(mysql_error());
}
// Todo: add a mobile detector
function is_SSL() {
if ($_SERVER['SERVER_PORT']!="443")
{
$url = "https://". $_SERVER['SERVER_NAME'] . ":443".$_SERVER['REQUEST_URI'];
header("Location: $url");
}
}
function session_check() {
session_start();
if (isset($_SESSION['username'])) {
include("protected/home.php");
} else {
include("protected/new-startpage.php");
}
}

//is_SSL();
session_check();
?>